<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('order_items', function (Blueprint $table) {
            $table->dateTime('pause_at')->nullable()->comment('暂停时间');
            $table->unsignedInteger('pause_minutes')->default(0)->comment('暂停分钟数');
        });

        Schema::table('tables', function (Blueprint $table) {
            $table->boolean('is_pause')->default(false)->comment('是否暂停');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('order_items', function (Blueprint $table) {
            $table->dropColumn('pause_at');
            $table->dropColumn('pause_minutes');
        });

        Schema::table('tables', function (Blueprint $table) {
            $table->dropColumn('is_pause');
        });
    }
};
